<style type="text/css">
	.product-item .thumbnail{
		height:220px;
		width:140px;
	}
	.product-item .title{
		font-weight:bold;
		font-size:10pt;	
		height:30px;
		line-height:15px;
		margin-bottom:3px;	
	}
	.product-item .price-before{
		font-size:8pt;
		color:red;
		text-decoration:line-through;
	}
	.product-item .label-tag{
		height:12px;
	}
	
</style>
<div class="panel-base">
	<div>
		<ul class="thumbnails">
			<?php if (count($data) > 0):
					for ($i=0; $i<count($data); $i++): ?>
						<li class="product-item">
							<div class="thumbnail">							
								<img class="text-center" src="<?php print $data[$i]['CAF_PDT_IMG']; ?>" style="width:140px; height:110px;" />							
								<div class="caption">
									<div class="title"><?php print $data[$i]['CAF_PDT_NAME']; ?></div>
									<div class="row-fluid">
										<?php if ($data[$i]['CAF_PDT_DC'] <= 0): ?>
											<span class="span8 price block"><?php printf('%.2f', $data[$i]['CAF_PDT_PRICE']); ?>฿</span>
										<?php else: ?>
											<div class="span8">
												<span class="price block"><i class="icon-tag"></i> <?php printf('%.2f', $data[$i]['CAF_PDT_PRICE'] - $data[$i]['CAF_PDT_DC']); ?>฿</span>
												<span class="price-before block"><?php printf('%.2f', $data[$i]['CAF_PDT_PRICE']); ?>฿</span>
											</div>
										<?php endif; ?>
										
										<span class="span4 text-right">										
											<a href="<?php print base_url() . $cafe_name; ?>/product/view/<?php print $data[$i]['CAF_PDT_CODE']; ?>" target="_blank" class="btn btn-mini btn-primary">view</a>											
										</span>
									</div>
									<div class="label-tag text-right">
										<?php if ($i < 1): ?>
											<img src="<?php print base_url(); ?>images/icon/system/ico-new.gif" />
										<?php endif; ?>
									</div>
								</div>
							</div>
						</li>
				<?php endfor; ?>																					
			<?php endif; ?>						
		</ul>
	</div>
	<div class="pagination">
		<?php if ($max_count > 0){?>	
			<ul>
			    <li><a href="<?php print base_url() . $cafe_name . '/product?p=1';
			    					if (!empty($current_category))
			    						print '&c=' . $current_category; ?>">First</a></li>    
			    <?php for ($i=0; $i<$max_count; $i++) {?>
			      	<li><a href="<?php print base_url() . $cafe_name . '/product?p=' . ($i+1); 
			      						if (!empty($current_category))
			    							print '&c=' . $current_category; ?>"><?php print $i+1; ?></a></li>
			    <?php }?>
			    <li><a href="<?php print base_url() . $cafe_name . '/product?p=' . $max_count;  
			    					if (!empty($current_category))
			    						print '&c=' . $current_category; ?>">Last</a></li>
			</ul>
		<?php } ?>
	</div>
</div>